package cn.ycgogo.org.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * The type Ajax result.
 * 状态对象,返回给前端判断
 * @author Yang
 * @date 2023 /1/12 10:31
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AjaxResult {
    private Boolean success = true;
    private String msg = "操作成功";
    private Object obj;


    /**
     * Instantiates a new Ajax result.
     *
     * @param msg     the msg
     * @param success the success
     */
    public AjaxResult(String msg, Boolean success) {
        this.msg = msg;
        this.success = success;
    }

    public static AjaxResult me(){
        return new AjaxResult();
    }

    public AjaxResult setMsg(String msg) {
        this.msg = msg;
        return this;
    }
    public AjaxResult setObj(Object obj) {
        this.obj = obj;
        return this;
    }
}
